﻿using UnityEngine;
using System.Collections;

namespace net {
	public class Buy : MonoBehaviour {
		public static Vector3 T_pos;

		bool hidden = true;

		void OnMouseDown() {
			string sceneName = Application.loadedLevelName;
			if ("netPlay".Equals (sceneName)) {
				// 判断，如果点的是敌方T_  return
				if (!transform.networkView.isMine) {
					return;
				}
				// 记录T_的位置
				T_pos = transform.position;
				// 显示购买按钮
				GameObject buyBtns = GameObject.FindGameObjectWithTag("BUYBTNS");
				if (hidden) {
					buyBtns.transform.localScale = new Vector3(1, 1, 1);
					hidden = false;
				}
				else {
					buyBtns.transform.localScale = new Vector3(0, 0, 0);
					hidden = true;
				}
			}
		}
	}
}